#pragma once
#include <vector>
#include <exception>
#include <string>

#include "test_result.h"

namespace krryn{
namespace test{
	class ignore : public std::exception {};

	class basic_test_suite;

	class duplicate_exception : public std::exception{
	public:
		typedef std::vector<basic_test_suite *> duplicate_list_t;

		duplicate_exception(const duplicate_list_t &a_Duplicates) : m_Duplicates(a_Duplicates) {}

		virtual const char *what() const throw();

	private:
		duplicate_list_t m_Duplicates;
	};

	class test_exception : public std::exception{
	public:
		virtual result to_result(const std::string &a_Group, size_t a_Nr, const std::string &a_TestName) = 0;
	};

	class fail_exception : public test_exception{
	public:
		fail_exception(const std::string &a_Message = "") : m_Message(a_Message) {}

		virtual result to_result(const std::string &a_Group, size_t a_Nr, const std::string &a_TestName) {
			return result(a_Group, a_Nr, a_TestName, m_Message, result::fail);
		}
	private:
		std::string m_Message;
	};

	class warning : public test_exception{
	public:
		virtual result to_result(const std::string &a_Group, size_t a_Nr, const std::string &a_TestName) {}
	};
}
}